package com.itfreer.data.check.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.itfreer.form.api.entity.EntityBase;
import com.itfreer.form.api.reflect.DictionaryField;

/**
 * 数据检查结果
 */
@Entity(name = "data_check_history_item")
@Table(indexes = { @Index(name = "check_history_hid", columnList = "s_hid") })
public class CheckHistoryItemEntity extends EntityBase implements Serializable {

	private static final long serialVersionUID = -1586471105523897157L;

	/**
	 * 主键
	 */
	@Id
	@Column(name = "id", nullable = false)
	private String id;

	/**
	 * 历史ID，外键
	 */
	@Column(name = "s_hid", length = 50, nullable = true)
	private String hid;

	/**
	 * 检查时间
	 */
	@Column(name = "s_checktime", nullable = true)
	private Date checktime;

	/**
	 * 检查状态
	 */
	@Column(name = "s_state", nullable = true)
	private String state;

	/**
	 * 检查结果
	 */
	@Column(name = "s_result", columnDefinition = "text", nullable = true)
	private String result;

	/**
	 * 备注说明
	 */
	@Column(name = "s_remarks", columnDefinition = "text", nullable = true)
	private String remarks;

	// 复制配置中参数
	/**
	 * 检查名称
	 */
	@Column(name = "s_name", nullable = false)
	private String name;

	/**
	 * 环节id
	 */
	@Column(name = "s_tacheid", nullable = true)
	private Integer tacheid;

	/**
	 * 环节名称
	 */
	@Column(name = "s_tachename", nullable = true)
	private String tachename;

	/**
	 * 排序号
	 */
	@Column(name = "i_order", nullable = true)
	private Integer order;

	/**
	 * 检查类型-强制型，提示型
	 */
	@Column(name = "s_type", nullable = true)
	@DictionaryField(dictionaryName = "d_checktype", toFieldName = "typeName")
	private String type;

	@Transient
	private String typeName;

	/**
	 * 检查规则
	 */
	@Column(name = "s_rule", columnDefinition = "text", nullable = true)
	private String rule;

	/**
	 * 检查规则说明
	 */
	@Column(name = "s_ruledesc", columnDefinition = "text", nullable = true)
	private String ruledesc;
	// 结束

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Date getChecktime() {
		return checktime;
	}

	public void setChecktime(Date checktime) {
		this.checktime = checktime;
	}

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public String getHid() {
		return hid;
	}

	public void setHid(String hid) {
		this.hid = hid;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getTacheid() {
		return tacheid;
	}

	public void setTacheid(Integer tacheid) {
		this.tacheid = tacheid;
	}

	public String getTachename() {
		return tachename;
	}

	public void setTachename(String tachename) {
		this.tachename = tachename;
	}

	public Integer getOrder() {
		return order;
	}

	public void setOrder(Integer order) {
		this.order = order;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Transient
	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public String getRule() {
		return rule;
	}

	public void setRule(String rule) {
		this.rule = rule;
	}

	public String getRuledesc() {
		return ruledesc;
	}

	public void setRuledesc(String ruledesc) {
		this.ruledesc = ruledesc;
	}
}
